package com.yanqu.road.server.cmd.cookboy;

import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.pb.cookboy.CookBoyProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_COOK_BOY_MATCH_REWARD, desc = "获取奖励信息")
public class GetCookBoyMatchRewardCmd extends AbstractCommand {

	int activityId;
	int no;

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		CookBoyProto.CookBoyMatchRewardReqMsg reqMsg = CookBoyProto.CookBoyMatchRewardReqMsg.parseFrom(packet.getBytes());
		activityId = reqMsg.getActivityId();
		no = reqMsg.getNo();
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		CookBoyProto.CookBoyMatchRewardReqMsg.Builder reqMsg = CookBoyProto.CookBoyMatchRewardReqMsg.newBuilder();
		reqMsg.setActivityId(activityId);
		reqMsg.setNo(no);
		YanQuMessage pbMsg = YanQuMessageUtils.buildMessage(Protocol.C_CROSS_COOK_BOY_MATCH_REWARD, reqMsg);
		GamePlayerMgr.sendPacket(player.getUserId(), pbMsg);
	}

	@Override
	public void sendData(GamePlayer player) {

	}
}
